<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j">


    <rich:popupPanel id="loginDialogWindow" autosized="true" header="#{bundle.loginHeader}" >
        <h:form>
            <h:panelGrid columns="3">

                <h:outputLabel for="username" value="#{bundle.loginUsername}" />
                <h:inputText size="30" value="#{loginBean.username}" id="username"
                             required="true"
                             requiredMessage="#{bundle.playerRequeredValidationMessage}" >
                    <f:validateRequired />
                    <rich:validator />
                </h:inputText>
                <rich:message for="username" />

                <h:outputLabel for="password" value="#{bundle.loginPassword}" />
                <h:inputSecret size="30" value="#{loginBean.password}" id="password"
                               required="true"
                               requiredMessage="#{bundle.playerRequeredValidationMessage}" >
                    <f:validateRequired />
                    <rich:validator />
                </h:inputSecret>
                <rich:message for="password" />
            </h:panelGrid>

            <rich:message for="loginDialogWindow"  />

            <div class="modalPanelActionButtons">
                <a4j:commandButton value="#{bundle.loginButton}" 
                                   action="#{loginBean.login}" 
                                   execute="loginDialogWindow"
                                   oncomplete="if(#{facesContext.maximumSeverity == null}){#{rich:component('loginDialogWindow')}.hide();location.reload();}"/>

                <a4j:commandButton value="#{bundle.cancelButton}" 
                                   onclick="#{rich:component('loginDialogWindow')}.hide();
                                           return false;" />
            </div>
        </h:form>
    </rich:popupPanel>

</ui:composition>

